{include file="public/header" /}
<span class="layui-breadcrumb">
  <a href="{:url('Blog/index')}?nav=blog-bloglist">分类</a>
  <a><cite>编辑-{$one['cname']}</cite></a>
</span>
<style> 
.layui-form-label{width:200px;}
.layui-form-item .layui-input-block{margin-left:230px;}
</style>
<div class="layui-fluid">
    <div class="layui-card">
      <form class="layui-form" id="product_form" action="" style='padding:10px'>
        <?php if(!empty($classify_seo)){?>
        <div class="layui-form-item">
              <label class="layui-form-label">标题</label>
              <div class="layui-input-block">
                <textarea id="title" name="title" style="width:100%;height:80px;">{$classify_seo['title']}</textarea>
              </div>
          </div>

        <div class="layui-form-item">
              
              <label class="layui-form-label">关键字</label>
              <div class="layui-input-block">
                <textarea id="keywords" name="keywords" style="width:100%;height:80px;">{$classify_seo['keywords']}</textarea>
              </div>
          </div>

        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <textarea id="description" name="description" style="width:100%;height:80px;">{$classify_seo['description']}</textarea>
            </div>
        </div>
        <?php }else{ ?>
        <div class="layui-form-item">
              <label class="layui-form-label">标题</label>
              <div class="layui-input-block">
                <textarea id="title" name="title" style="width:100%;height:80px;"></textarea>
              </div>
          </div>

        <div class="layui-form-item">
              
              <label class="layui-form-label">关键字</label>
              <div class="layui-input-block">
                <textarea id="keywords" name="keywords" style="width:100%;height:80px;"></textarea>
              </div>
          </div>

        <div class="layui-form-item">
            <label class="layui-form-label">描述</label>
            <div class="layui-input-block">
              <textarea id="description" name="description" style="width:100%;height:80px;"></textarea>
            </div>
        </div>
        <?php }?>

        <div class="layui-form-item">
           
            <div class="layui-input-block" style="color: red;">
              单页面不存在筛选，单页面不显示以下信息
            </div>
        </div>
      <?php 
        $route_id=Db::table('lily_classify')->field('route_id')->where('id',$one['id'])->find();
        if($route_id['route_id']==2){
      ?>
      <?php if(!empty($classify_seo)){?>
        <div class="layui-form-item">
            <label class="layui-form-label">筛选标题</label>
            <div class="layui-input-block">
              <textarea id="filter_title" name="filter_title" style="width:100%;">{$classify_seo['filter_title']}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">筛选关键字</label>
            <div class="layui-input-block">
              <textarea id="filter_keywords" name="filter_keywords" style="width:100%;height:80px;">{$classify_seo['filter_keywords']}</textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">筛选描述</label>
            <div class="layui-input-block">
              <textarea id="filter_description" name="filter_description" style="width:100%;height:80px;">{$classify_seo['filter_description']}</textarea>
            </div>
        </div>
        <?php }else{ ?>
        <div class="layui-form-item">
            <label class="layui-form-label">筛选标题</label>
            <div class="layui-input-block">
              <textarea id="filter_title" name="filter_title" style="width:100%;"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">筛选关键字</label>
            <div class="layui-input-block">
              <textarea id="filter_keywords" name="filter_keywords" style="width:100%;height:80px;"></textarea>
            </div>
        </div>
        <div class="layui-form-item">
            <label class="layui-form-label">筛选描述</label>
            <div class="layui-input-block">
              <textarea id="filter_description" name="filter_description" style="width:100%;height:80px;"></textarea>
            </div>
        </div>
        <?php }?>

      <?php } ?> 
       
      

        <div class="layui-form-item">
          <label class="layui-form-label"></label>
          <div class="layui-input-block">
             <button type='button' class="layui-btn layui-btn-normal" onclick="tijiao({$one['id']})">确定</button>
          </div>
        </div>

        <div class="layui-form-item">
              <div class="layui-input-block">
                页面链接 : <a style="color: #36648a" href="/{:get_class_uplower_url($one['id'])}" target='_blank'>{$one['cname']}</a>
              </div>
          </div>

    </form>
    </div>
</div>
{include file="/public/footer" /}
<script>

 function tijiao(id){
    layer.load();
    var title=$.trim($("textarea[name='title']").val());
    var keywords=$.trim($("textarea[name='keywords']").val());
    var description=$.trim($("textarea[name='description']").val());
    var filter_title=$.trim($("textarea[name='filter_title']").val());
    var filter_keywords=$.trim($("textarea[name='filter_keywords']").val());
    var filter_description=$.trim($("textarea[name='filter_description']").val());
    if(title==''){
      layer.closeAll();
      layer.msg('标题不能为空');
      return false;
    }

    $.post("{:url('Classify/tdk')}",{id:id,
      title:title,
      keywords:keywords,
      description:description,
      filter_title:filter_title,
      filter_keywords:filter_keywords,
      filter_description:filter_description
    },function(res){
      if(res.status=='0'){
        layer.closeAll('loading');
        layer.msg(res.msg);
      }
      if(res.status=='1'){
        layer.msg(res.msg,{time: 500 },
        function(){
          layer.closeAll();
          location.href=location.href;
        });
      }
    })
 }
</script>
